package com.example.demo.controller;

import com.example.demo.webScoket.MyWebSocketHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/api/v1", produces = {MediaType.APPLICATION_JSON_VALUE})
public class HealthController {

    @Autowired
    MyWebSocketHandler myWebSocketHandler;

    @GetMapping(value = "/info")
    public String info() throws Exception {
        myWebSocketHandler.sendMessage("001","服务端与客户端信息通讯");
        return null;
    }

}